package kuwo

import (
	"api-go/serializer"
	kuwo "api-go/service/v1/kuwo"
	"fmt"

	"github.com/gin-gonic/gin"
)

//获取排行榜信息
func TopInfo(c *gin.Context) {
	var service kuwo.Top
	var res *serializer.Response
	if err := c.ShouldBindQuery(&service); err != nil {
		fmt.Println(err)
		res = serializer.ErrorResponse(serializer.CodeParamError)
	} else {
		res = service.TopInfo()
	}
	c.JSON(200, res)
}

//获取排行榜分类
func TopCat(c *gin.Context) {
	var service kuwo.Top
	var res *serializer.Response
	if err := c.ShouldBindQuery(&service); err != nil {
		fmt.Println(err)
		res = serializer.ErrorResponse(serializer.CodeParamError)
	} else {
		res = service.TopCat()
	}
	c.JSON(200, res)
}
